/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.anhdt.model;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 *
 * @author Anh Dinh
 */
public class SessionCounter implements HttpSessionListener {

    public static int counter = 0;
    
    @Override
    public void sessionCreated(HttpSessionEvent se) {
        SessionCounter.counter++;
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        SessionCounter.counter--;
    }
    public static int getCounter(){
        return counter;
    }
    
    
}
